﻿@model NB.MGJ.Model.AntiFleeing_Warehouse
@{
    Layout = null;
}

@*<div>新增仓库管理</div>*@
<script src="~/Scripts/MGJJS/Manager/WareHouselist.js"></script>
<style>
    #form_AddWareHouse.form_AddWareHouse   .form-group {
        margin-bottom: 15px;
    }
    .help-block {
        color: #f96868;
    }
</style>
<form class="form_AddWareHouse form-horizontal" id="form_AddWareHouse" role="form" onkeydown="if(event.keyCode==13){return false;}">

    <div class="form-group">
        <label class="col-sm-2 text-right"><span class="red-600">*</span>所属机构：</label>
        <div class="col-sm-4">
            @Html.DropDownList("EnterpriseId", null, new { @class = "form-control" })
        </div>
        <label class="col-sm-2 text-right"><span class="red-600">*</span>仓库名称：</label>
        <div class="col-sm-4">
            @Html.TextBoxFor(p => p.WarehouseName, new { @class = "form-control", placeholder = "请输入仓库名称", maxlength = 25 })
        </div>
    </div>

    <div class="form-group">
        <div class="rowGroup">
            <label class="col-sm-2 text-right">地址：</label>
            <div class="col-sm-4">
                @Html.TextBoxFor(p => p.Address, new { @class = "form-control", placeholder = "请输入地址", maxlength = 50 })
            </div>
        </div>
        <div class="rowGroup">
            <label class="col-sm-2 text-right"><span class="red-600"></span>所属片区：</label>
            <div class="col-sm-4">
                @*<select class="form-control EmptyValidationText" id="SaleAreaId" name="SaleAreaId"></select>*@
                @Html.DropDownList("SaleAreaId", null, new { @class = "form-control" })
            </div>
        </div>

    </div>
    <div class="form-group">
        <div class="rowGroup">
            <label class="col-sm-2 text-right">联系人：</label>
            <div class="col-sm-4">
                @Html.TextBoxFor(p => p.Contacts, new { @class = "form-control", placeholder = "请输入联系人", maxlength = 20 })
            </div>
        </div>
        <div class="rowGroup">
            <label class="col-sm-2 text-right">联系方式：</label>
            <div class="col-sm-4">
                @Html.TextBoxFor(p => p.ContactTel, new { @class = "form-control", placeholder = "请输入手机或电话(如：0511-4405222、021-87888822)", maxlength = 13 })
            </div>
        </div>



    </div>
    <div class="form-group" style="margin-bottom:15px;">
        <label class="col-sm-2 text-right">备注：</label>
        <div class="col-sm-10">
            @Html.TextBoxFor(p => p.Remark, new { @class = "form-control", })
        </div>
    </div>
</form>
<script>

    $('#form_AddWareHouse').bootstrapValidator({
        group: '.rowGroup',
        fields: {
            EnterpriseId: {
                validators: {
                    notEmpty: {
                        message: '所属机构不能为空'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9_ \u4e00-\u9fa5]+$/,
                        message: '所属机构不能输入符号'
                    },
                    stringLength: {
                        max: 20,
                        message: '所属机构最大长度为20',
                    },
                }
            },
            Address: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '地址不能输入符号'
                    },
                    stringLength: {
                        max: 50,
                        message: '地址最大长度为50',
                    },
                }
            },
            Contacts: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '联系人不能输入符号'
                    },
                    stringLength: {
                        max: 20,
                        message: '联系人最大长度为20',
                    },
                }
            },
            WarehouseName: {
                validators: {
                    notEmpty: {
                        message: '仓库名称不能为空'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '仓库名称不能输入符号'
                    },
                    stringLength: {
                        max: 25,
                        message: '仓库名称最大长度为25'
                    }
                }
            },
            ContactTel: {
                validators: {
                    regexp: {
                        regexp: /^[0-9]*$/,
                        message: '联系方式格式错误'
                    }
                }
            },
        }
    });
</script>
